package edu.mapi.ir.controllers.reactive;

import java.util.Random;

import edu.mapi.ir.ciberIF.ciberIF;

/**
 * Random walk controller (the vehicle wanders in the map)
 * @author ZP
 */
public class RandomWalk implements ReactiveController {

	Random random = new Random(System.currentTimeMillis());
	double diff = 0.0;
	
	public boolean decide(ciberIF cif) {
		
		if (random.nextInt(20) == 1) {
			diff = 0.2 * (random.nextDouble());
		}
		
		cif.DriveMotors(0.1-diff,0.1+diff);		
		
		return true;
	}

	public String getDescription() {
		return "Random Walk";
	}
}
